using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_AccessRowDataMap : EntityTypeConfiguration<t_AccessRowData>
    {
        public t_AccessRowDataMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FType, t.FClassID, t.FAccessType });

            // Properties
            this.Property(t => t.FType)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FClassID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FAccessType)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FFromTable)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FAccessTable)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FAccessColName)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("t_AccessRowData");
            this.Property(t => t.FType).HasColumnName("FType");
            this.Property(t => t.FClassID).HasColumnName("FClassID");
            this.Property(t => t.FAccessType).HasColumnName("FAccessType");
            this.Property(t => t.FMaskAccess).HasColumnName("FMaskAccess");
            this.Property(t => t.FFromTable).HasColumnName("FFromTable");
            this.Property(t => t.FAccessTable).HasColumnName("FAccessTable");
            this.Property(t => t.FAccessColName).HasColumnName("FAccessColName");
            this.Property(t => t.FUsed).HasColumnName("FUsed");
        }
    }
}
